<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../../JavaScript/jQuery.js"></script>
  <script>
    $(function () {
      $('#btn').click(function () {
        if (/^[\u4e00-\u9fa5]{2,6}$/.test($('#ipt').val())) {
          $('#ipt').css('backgroundColor','yellow');
        }else {
          $('#ipt').css('backgroundColor','red');
        }
      });
    });
  </script>
</head>
<body>
  输入中文:<input type="text" id="ipt" />
  <button id="btn">验证</button>
</body>
</html>